using System;
using System.Collections.Generic;
using UnityEngine;
using Object = UnityEngine.Object;

namespace Framework
{
    public static class DebugUtil
    {
        private static HashSet<object> BreakBuffer = new();
        public static void SingleTimeBreak(Exception e, object key)
        {
            Debug.LogException(e);
            if (BreakBuffer.Add(key)) Debug.Break();
        }

        public static void EditorLog(object message)
        {
            #if UNITY_EDITOR
            Debug.Log(message);
            #endif
        }

        public static void EditorLog(object message, Object context)
        {
            #if UNITY_EDITOR
            Debug.Log(message, context);
            #endif
        }

        public static void EditorLogWarning(string message)
        {
            #if UNITY_EDITOR
            Debug.LogWarning(message);
            #endif
        }

        public static void EditorLogWarning(string message, Object context)
        {
            #if UNITY_EDITOR
            Debug.LogWarning(message, context);
            #endif
        }

        public static void EditorLogError(string message)
        {
            #if UNITY_EDITOR
            Debug.LogError(message);
            #endif
        }

        public static void EditorLogError(string message, Object context)
        {
            #if UNITY_EDITOR
            Debug.LogError(message, context);
            #endif
        }

        public static void EditorLogException(Exception e)
        {
            #if UNITY_EDITOR
            Debug.LogException(e);
            #endif
        }

        public static void EditorLogException(Exception e, Object context)
        {
            #if UNITY_EDITOR
            Debug.LogException(e, context);
            #endif
        }
    }
}